<template>
  <div>
    <div class="banner" @click="handleBannerShow">
      <img class="banner-img" :src="bannerImg" alt="">
      <div class="banner-info">
        <div class="banner-title">{{this.sightName}}</div>
        <div class="banner-sub-title"><span class="iconfont">&#xe730;</span>{{this.gallaryImgs.length}}</div>
      </div>
    </div>
    <fade-animation>
      <common-gallary :imgs="gallaryImgs" v-show="showGallary" @close="handleGallaryClick"></common-gallary>
    </fade-animation>
  </div>
</template>
<script>
import CommonGallary from 'common/gallary/Gallary'
import FadeAnimation from 'common/fade/fade'
export default {
  name: 'DetailBanner',
  props: {
    sightName: String,
    bannerImg: String,
    gallaryImgs: Array,
    list: Array
  },
  data () {
    return {
      showGallary: false
    }
  },
  components: {
    CommonGallary,
    FadeAnimation
  },
  methods: {
    handleBannerShow () {
      this.showGallary = true
    },
    handleGallaryClick () {
      this.showGallary = false
    }
  }
}
</script>
<style lang="stylus" scoped>
  .banner
    position relative
    overflow hidden
    height 0
    padding-bottom 55%
    img
      width 100%
    .banner-info
      width 100%
      height .68rem
      position absolute
      left 0
      bottom 0
      color #fff
      display flex
      justify-content space-between
      align-items center
      background-image linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.8))
      .banner-title
        font-size .4rem
        font-weight blod
        padding-left .1rem
        padding-bottom .2rem
      .banner-sub-title
        background black
        padding .1rem
        border-radius .1rem
        font-size .32rem
        margin-right .1rem
        color #fff
        .iconfont
          margin-right .1rem
</style>
